<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>测试</title>
</head>
<body style="padding-left: 50px">
  <h1>内建函数</h1>
  <div>
      <ul>
          <h2>1.字符串内建函数</h2>
          <#list "a|b|c|d"?split("|") as item>
              <li>${item}</li>
          </#list>

          <#--字符串转日期-->
          <#assign var1 = "01/03/2017"?date("dd/MM/yyyy") />
          <#assign var2 = "15:05:30"?time("HH:mm:ss") />
          <#assign var3 ="2016-12-31 03:05 PM"?datetime("yyyy-MM-dd hh:mm") />
          <li>${var1}</li>
          <li>${var2}</li>
          <li>${var3}</li>

          <h2>2.数字类型的内建函数</h2>
          <#assign numVar1=314.5662/>
          <li>${numVar1?string("0.##")}</li>
          <li>${numVar1?round}</li>

          <h2>3.list内建函数</h2>
          <#assign listVar = [1,2,3,4,11,12,13,14,21,22,23,24]/>
          <li>${listVar?chunk(4)?size}</li>
          <#list listVar?chunk(4)?last as item>
              <li>${item}</li>
          </#list>

          <h2>4.其他内建函数</h2>
          <#assign sVar="hello"/>
          <li>${sVar?is_number?string("yes", "no")}</li>
          <li>${sVar?has_content?string("yes", "no")}</li>
          <li>${"1"+"2"?eval}</li>
      </ul>
  </div>
</body>
</html>